package ae.pcfc.etks.online.common.domain;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinColumns;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

/**
 * ProcStepAthmnt entity. @author Mohtisham.Salahria
 */
@Entity
@Table(name = "T_ETKS_PROC_STEP_ATHMNT", schema = "ETKS_ONLINE_DBA")
@SequenceGenerator(name = "SQ_ETKS_PROC_STP_ATMT", sequenceName = "SQ_ETKS_PROC_STP_ATMT", initialValue = 1, allocationSize = 1)
public class ProcStepAthmnt implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	private Long attachmentId;
	private AppMetaData AppMetaData;
	private AttachmentType AttachmentType;
	private ProcessStep ProcessStep;
	private String attachmentPath;

	public ProcStepAthmnt() {
	}

	public ProcStepAthmnt(Long attachmentId) {
		this.attachmentId = attachmentId;
	}

	public ProcStepAthmnt(Long attachmentId,
			AppMetaData AppMetaData,
			AttachmentType AttachmentType,
			ProcessStep ProcessStep, String attachmentPath) {
		this.attachmentId = attachmentId;
		this.AppMetaData = AppMetaData;
		this.AttachmentType = AttachmentType;
		this.ProcessStep = ProcessStep;
		this.attachmentPath = attachmentPath;
	}

	@Id
	@GeneratedValue( strategy = GenerationType.SEQUENCE, generator="SQ_ETKS_PROC_STP_ATMT")
	@Column(name = "ATTACHMENT_ID", unique = true, nullable = false, length = 10)
	public Long getAttachmentId() {
		return this.attachmentId;
	}

	public void setAttachmentId(Long attachmentId) {
		this.attachmentId = attachmentId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "APPLICATION_ID")
	public AppMetaData getAppMetaData() {
		return this.AppMetaData;
	}

	public void setAppMetaData(AppMetaData AppMetaData) {
		this.AppMetaData = AppMetaData;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ATTACHMENT_TYPE_CODE")
	public AttachmentType getAttachmentType() {
		return this.AttachmentType;
	}

	public void setAttachmentType(AttachmentType AttachmentType) {
		this.AttachmentType = AttachmentType;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumns({
			@JoinColumn(name = "PROCESS_STEP_CODE", referencedColumnName = "PROCESS_STEP_CODE"),
			@JoinColumn(name = "PROCESS_CODE", referencedColumnName = "PROCESS_CODE") })
	public ProcessStep getProcessStep() {
		return this.ProcessStep;
	}

	public void setProcessStep(ProcessStep ProcessStep) {
		this.ProcessStep = ProcessStep;
	}

	@Column(name = "ATTACHMENT_PATH", length = 500)
	public String getAttachmentPath() {
		return this.attachmentPath;
	}

	public void setAttachmentPath(String attachmentPath) {
		this.attachmentPath = attachmentPath;
	}

}
